package com.walker.security.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/security")
public class SecurityController {

	@RequestMapping(value = "/hello.do")
	@ResponseBody
	public String hello() {
		return "Hello Spring Security";
	}
	
	@RequestMapping(value = "/roleAuth.do")
	@ResponseBody
	@PreAuthorize("hasRole('ROLE_ADMIN')")
	public String roleAuth() {
		return "Role Access";
	}
}
